const buf = Buffer.from([1, 2, 3])
for (const b of buf) {
    console.log(b)
}
console.log(buf.values(), buf.keys(), buf.entries())

function cifang(num, cifang) {
    let r = 1,
        c = Math.abs(cifang)

    for (let i = c; i > 0; i--) {
        r *= num
    }
    if (cifang < 0)
        return 1 / r
    return r
}

function digui(num, cifang) {
    if (cifang == 0) {
        return 1
    }
    let r = 1
    if (cifang > 0) {
        r = digui(num, cifang - 1) * num
    } else {
        r = 1 / digui(num, Math.abs(cifang))
    }
    return r
}

console.log(digui(2, 8))
console.log(digui(2, 0))
console.log(digui(2, -0))
console.log(digui(2, -1))
console.log(digui(2, 16))
console.log(digui(2, -16))